import axios from '@/api/interceptor';
import type { CommentLikeForm, CommentSubmitParams } from '@/api/comment/types.ts';

export const createComment = async (formData:CommentSubmitParams) => {
  const result = await axios({
    url: '/commentFront/createComment',
    method: 'POST',
    data: formData
  });
  return result.data;
};

export const getCommentsByArticleId = async (params:any) => {
  const result = await axios({
    url: '/commentFront/getCommentsByArticleId',
    method: 'GET',
    params,
  });
  return result.data;
};


export const likeComment = async (formData:CommentLikeForm) => {
  const result = await axios({
    url: '/commentFront/likeComment',
    method: 'POST',
    data:formData
  });
  return result.data;
};

export const dislikeComment = async (formData:CommentLikeForm) => {
  const result = await axios({
    url: '/commentFront/dislikeComment',
    method: 'POST',
    data:formData
  });
  return result.data;
};



